import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { InfoVO, InfoForm, InfoQuery } from '@/api/bykt/info/types';


/**
 * 查询课程相关信息
 * @param data
 */
export const getTreeListInfo = (data:any) => {
  return request({
    url: '/bykt/course/queryCourseLists',
    method: 'post',
    data: data || {}
  });
};



/**
 * 查询课程信息详细
 * @param id
 */
export const getCourseInfo = (id: string | number): AxiosPromise<InfoVO> => {
  return request({
    url: '/bykt/course/' + id,
    method: 'get'
  });
};



/**
 * 删除试卷信息
 * @param id
 */
export const delCourseInfo = (id: string | number | Array<string | number>) => {
  return request({
    url: '/bykt/course/' + id,
    method: 'delete'
  });
};

export const addTreeFirstCourse = (data:any) => {
  return request({
    url: '/bykt/course',
    method: 'post',
    data: data || {}
  });
};


export const editTreeFirstCourse = (data:any) => {
  return request({
    url: '/bykt/course',
    method: 'put',
    data: data || {}
  });
};

export const getCourseList = (query) => {
  return request({
    url: '/bykt/course/list',
    method: 'get',
    params: {...query}
  });
};
// /bykt/category/list

export const getCategoryTypeList = (query) => {
  return request({
    url: '/bykt/category/list',
    method: 'get',
    params: {pageNum:1,pageSize:100000000,...query}
  });
};
